<?php if (empty($data) || count($data) == 0) { ?>
<div style="text-align:center; padding-top:20px;"><?php __('no result found'); ?></div>
<?php } else if (isset($data['A']) && count($data['A']) > 0) { ?>
<div style="border-bottom:1px solid #ccc; padding:5px; font-weight:bold;">
  <?php echo r('%total%', count($data['A']), __('There are total %total% sponsored members in your Left (A), which is shown in the tree view. Their information as below.',true)); ?>
</div>
<table width="100%" cellpadding="2" cellspacing="0" border="0" class="reportTbl reportTbl2">
  <thead>
    <tr>
      <td>#</td>
      <td><?php __('Id.'); ?></td>
      <td><?php __('Country'); ?></td>
      <td width="130"><?php __('Agent Name'); ?></td>
      <td width="60"><?php __('Tree'); ?></td>
      <td><?php __('Level'); ?></td>
      <td width="100"><?php __('Entitle to retain downline BV'); ?></td>
      <td width="100"><?php __('Total Persoanl Purchase BV'); ?></td>
      <td width="100"><?php __('BV need to Buy by this month'); ?></td>
      <td><?php __('Medal'); ?></td>
    </tr>
  </thead>
  <tbody>
<?php     foreach ($data['A'] as $i=>$row) {
              $no    = $i+1;
              $style = ($i%2==0)?'':' style="background-color: #E3E3E3;"'; ?>
    <tr>
      <td align="right"<?php e($style); ?>><?php e($no); ?>.</td>
      <td><?php e($row['id']); ?></td>
      <td><?php e($row['country']); ?></td>
      <td><?php e($row['name']); ?></td>
      <td><div title="<?php __('View'); ?>" class="tree" style="height:16px; margin-left:22px;"></div></td>
      <td align="center"><?php e($row['level']); ?></td>
      <td align="center"><?php echo isset($row['rdb'])?$row['rdb']:'-'; ?></td>
      <td align="center"><?php echo isset($row['pbv'])?$row['pbv']:'-'; ?></td>
      <td align="center"><?php echo isset($row['rbv'])?$row['rbv']:'-'; ?></td>
      <td><?php e($row['medal']); ?></td>
    </tr>
<?php     } ?>
  </tbody>
</table>
<?php }
      if (isset($data['B']) && count($data['B']) > 0) { ?>
<div style="border-bottom:1px solid #ccc; padding:5px; margin-top:20px; font-weight:bold;">
  <?php echo r('%total%', count($data['B']), __('There are total %total% sponsored members in your Right (B), which is shown in the tree view. Their information as below.',true)); ?>
</div>
<table width="100%" cellpadding="2" cellspacing="0" border="0" class="reportTbl reportTbl2">
  <thead>
    <tr>
      <td>#</td>
      <td><?php __('Id.'); ?></td>
      <td><?php __('Country'); ?></td>
      <td width="130"><?php __('Agent Name'); ?></td>
      <td width="60"><?php __('Tree'); ?></td>
      <td><?php __('Level'); ?></td>
      <td width="100"><?php __('Entitle to retain downline BV'); ?></td>
      <td width="100"><?php __('Total Persoanl Purchase BV'); ?></td>
      <td width="100"><?php __('BV need to Buy by this month'); ?></td>
      <td><?php __('Medal'); ?></td>
    </tr>
  </thead>
  <tbody>
<?php     foreach ($data['B'] as $i=>$row) {
              $no    = $i+1;
              $style = ($i%2==0)?'':' style="background-color: #E3E3E3;"'; ?>
    <tr>
      <td align="right"<?php e($style); ?>><?php e($no); ?>.</td>
      <td><?php e($row['id']); ?></td>
      <td><?php e($row['country']); ?></td>
      <td><?php e($row['name']); ?></td>
      <td><div title="<?php __('View'); ?>" class="tree" style="height:16px; margin-left:22px;"></div></td>
      <td align="center"><?php e($row['level']); ?></td>
      <td align="center"><?php echo isset($row['rdb'])?$row['rdb']:'-'; ?></td>
      <td align="center"><?php echo isset($row['pbv'])?$row['pbv']:'-'; ?></td>
      <td align="center"><?php echo isset($row['rbv'])?$row['rbv']:'-'; ?></td>
      <td><?php e($row['medal']); ?></td>
    </tr>
<?php     } ?>
  </tbody>
</table>
<?php } ?>